; ORIGINAL: 3dt2.1/examples/mouse.scm
; $Id: mouse.scm,v 1.4 1997/04/30 20:24:14 jread Exp $
;- mouse.scm ------------------------------------------------------
; Set mouse down hook to display "button # down" when any mouse
; button is depressed.
;------------------------------------------------------------------
(require 'old-rb "old-rb.scm")

(set! mouse-down-hook
  (lambda (pe)
    (display " button ")
    (display (event:button pe))
    (display " down \n")))


;-mouse.scm -------------------------------------------------------
; Set mouse up hook to display "button # up" when any mouse
; button is released.
;------------------------------------------------------------------
(set! mouse-up-hook
  (lambda (pe)
    (display " button ")
    (display (event:button pe))
    (display " up \n")))


;-mouse.scm -------------------------------------------------------
; Set mouse up hook to display "button # up" when any mouse
; button is released.
;------------------------------------------------------------------
(set! mouse-up-hook
  (lambda (pe)
    (display " button ")
    (display (event:button pe))
    (display " up \n")))


;-mouse.scm -------------------------------------------------------
; Set rubber band end hook to display "rubber banding is now off"
; when rubber banding is turned off using (rb:scheme #f).
;------------------------------------------------------------------
(set! rb-end-hook
  (lambda ()
    (display "rubber banding is now off.\n")))


;-mouse.scm -------------------------------------------------------
; Set rubber band init hook to display "rubber banding is now on"
; when rubber banding is turned on using (rb:scheme #t).
;------------------------------------------------------------------
(set! rb-init-hook
  (lambda ()
    (display "rubber banding is now on.\n")))


;-mouse.scm -------------------------------------------------------
; Set rubber band repaint hook to display "rubber band repaint called"
; when a repaint event occurs (PC only).
;------------------------------------------------------------------
(set! rb-repaint-hook
  (lambda ()
    (display "rubber band repaint called.\n")))


;-mouse.scm -------------------------------------------------------
; Set rubber band start hook to display "entering viewport"
; when the cursor is moved into a viewport.
;------------------------------------------------------------------
(set! rb-start-hook
  (lambda (pe)
    (display "entering viewport.\n")))


;-mouse.scm -------------------------------------------------------
; Set rubber band stop hook to display "exiting viewport"
; when the cursor is moved out of a viewport.
;------------------------------------------------------------------
(set! rb-stop-hook
  (lambda ()
    (display "exiting viewport.\n")))


;-mouse.scm -------------------------------------------------------
; Set rubber band update hook to display "mouse moved to (x,y)"
; when a mouse movement occurs.
;------------------------------------------------------------------
(set! rb-update-hook
  (lambda (pe)
    (display "mouse moved to (")
    (display (event:x pe))
    (display ", ")
    (display (event:y pe))
    (display ")\n")))
(rb:scheme #t)


